const { Sequelize, sequelize } = require('../db/db')

const Artcle = sequelize.define('ag_blog', {
    id: {
      type: Sequelize.NUMBER,
      validate: {
        notEmpty:true
      }
    },
    title: {
      type: Sequelize.STRING,
      validate: {
        notEmpty:true
      }
    },
    type: {
      type: Sequelize.NUMBER,
      validate: {
        notEmpty:true
      }
    },
    content: {
      type: Sequelize.TEXT,
      validate: {
        notEmpty:true
      }
    },
    user_id: {
      type: Sequelize.NUMBER,
      validate: {
        notEmpty:true
      }
    },
    is_del: {
      type: Sequelize.NUMBER,
      validate: {
        notEmpty:true
      }
    },
    create_time: {
      type: Sequelize.STRING,
      validate: {
        notEmpty:true
      }
    },
    update_time: {
      type: Sequelize.STRING,
      validate: {
        notEmpty:true
      }
    }
  })

Artcle.sync().then(() => {
    console.log('模型同步成功');
})

module.exports = {Artcle}